#!/bin/sh

VERSION="$(cat ../version)"
OUTPUT_DIR="output/predesys-server-$VERSION-codedoc"
mkdir -p $OUTPUT_DIR
OUTPUT_DIR_2="$(readlink -f $OUTPUT_DIR)"

UI01="$(readlink -f ../src/adminui/addressesui.py)"
UI02="$(readlink -f ../src/adminui/predesysserver.py)"
UI03="$(readlink -f ../src/adminui/servicepermissionsui.py)"
UI04="$(readlink -f ../src/adminui/servicesui.py)"
UI05="$(readlink -f ../src/adminui/servicetypesui.py)"
UI06="$(readlink -f ../src/adminui/systemui.py)"
UI07="$(readlink -f ../src/adminui/tools.py)"
UI08="$(readlink -f ../src/adminui/usage.py)"
UI09="$(readlink -f ../src/adminui/usergroupsui.py)"
UI10="$(readlink -f ../src/adminui/usersui.py)"

CORE01="$(readlink -f ../src/core/addresslog.py)"
CORE02="$(readlink -f ../src/core/configuration.py)"
CORE03="$(readlink -f ../src/core/coreexceptions.py)"
CORE04="$(readlink -f ../src/core/data.py)"
CORE05="$(readlink -f ../src/core/security.py)"
CORE06="$(readlink -f ../src/core/servicepermissions.py)"
CORE07="$(readlink -f ../src/core/services.py)"
CORE08="$(readlink -f ../src/core/simplexml.py)"
CORE09="$(readlink -f ../src/core/system.py)"
CORE10="$(readlink -f ../src/core/users.py)"

ERRORLOG1="$(readlink -f ../src/errorlog/daemon.py)"
ERRORLOG2="$(readlink -f ../src/errorlog/errorlog.py)"
ERRORLOG3="$(readlink -f ../src/errorlog/logserver.py)"

RADAR1="$(readlink -f ../src/services/radar.py)"

SERVICES1="$(readlink -f ../src/webservice/predesysserverwebservice.py)"
SERVICES2="$(readlink -f ../src/webservice/daemon.py)"

epydoc --html --no-frames --no-sourcecode --name "Predesys Server $VERSION Code Documentation" --docformat epytext --output=$OUTPUT_DIR_2 $UI01 $UI02 $UI03 $UI04 $UI05 $UI06 $UI07 $UI08 $UI09 $UI10 $CORE01 $CORE02 $CORE03 $CORE04 $CORE05 $CORE06 $CORE07 $CORE08 $CORE09 $CORE10 $ERRORLOG1 $ERRORLOG2 $ERRORLOG3 $RADAR1 $SERVICES1 $SERVICES2
